Dependencies: iterate available versions to find compatible installer for dependency resolution#5938
Conversation
… for dependency resolution
|
@microsoft-github-policy-service agree |
|
This was my first try to "fix" something with the help of @copilot . Local compile fails, so I don't know if this code even compiles. |
JohnMcPMS
left a comment
There was a problem hiding this comment.
This has been a draft for a while so I was letting it sit. If you want it to move forward then I think it does need some refactoring and at least one test for this case.
| Manifest::ManifestComparator manifestComparator(GetManifestComparatorOptions(m_context, installationMetadata)); | ||
|
|
||
| auto versionKeys = availableVersions->GetVersionKeys(); | ||
| for (const auto& key : versionKeys) |
There was a problem hiding this comment.
This algorithm for finding a valid version should be shared via function instead of copy-paste. I realize that it has some dependency specifics in it, but that can be parameterized.
There was a problem hiding this comment.
I used the CoPilot chat on front page to solve it and I was never able to compile it locally, so I have no idea if this ever works. Does the team ever plans to implement a proper fix for it? If yes, I can close it
Summary:
When resolving package dependencies, winget previously selected only a single "latest" available package version and then attempted installer selection for that version. If that latest version lacked a compatible installer (for example, only x64/arm64 when x86 was required), dependency resolution failed immediately.
The normal install/update flows already iterate versions until they find a compatible installer; this change brings dependency resolution in line with that behavior.
What I changed:
How to test:
Risks / notes:
Fixes: #5902
Microsoft Reviewers: Open in CodeFlow